package com.atguigu.yygh.hosp.controller;


import com.atguigu.yygh.result.R;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/yygh/userlogin")
//@CrossOrigin 配置gateway网关后,不需要该注解 网关已经解决跨域问题
public class UserLoginController {

    //管理员登录
    @PostMapping("/user/login")
    public R userLogin(@RequestBody String username, String password){
        //按框架要求,返回响应的数据
        return R.ok().data("token","admin-token");

    }

    //用户信息
    @GetMapping("/user/info")
    public R userInfo(){
        //按框架要求,返回响应的数据
        return R.ok().data("roles","[admin]").data("introduction","I am a super administrator")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("name","Super Admin");
    }
}
